Rename '$wgStreamLoggers' => '$wgRCEngines'
authorOri Livneh <ori@wikimedia.org>
Mon, 26 Aug 2013 20:58:29 +0000 (13:58 -0700)
committerOri Livneh <ori@wikimedia.org>
Mon, 26 Aug 2013 21:01:47 +0000 (14:01 -0700)
The name '$wgStreamLoggers' captures the direction in which I'd like to see
this evolve, but for the time being it is a misnomer, giving the false
impression that it is more general than it in fact is. I did not bother
deprecating the old name since it was only merged to master yesterday.

Also renamed: RecentChange::getStreamEngine -> RecentChange::getEngine (for
consistency with the change to the config var name).

Change-Id: I0d7b08e591e897b24528ea0981a6fcb93cfe8831

includes/DefaultSettings.php
includes/RecentChange.php

index 20c72ee..22b7f1e 100644 (file)
@@ -5470,10 +5470,10 @@ $wgRC2UDPOmitBots = false;
 $wgRCFeeds = array();
 
 /**
- * Used by RecentChange::getStreamEngine to find the correct engine to use for a given URI protocol.
+ * Used by RecentChange::getEngine to find the correct engine to use for a given URI scheme.
  * Keys are scheme names, values are names of engine classes.
  */
-$wgStreamLoggers = array(
+$wgRCEngines = array(
        'udp' => 'UDPRCFeedEngine',
 );
 
index 939e924..45a8fbc 100644 (file)
@@ -317,7 +317,7 @@ class RecentChange {
                global $wgRCFeeds;
 
                foreach ( $wgRCFeeds as $feed ) {
-                       $engine = self::getStreamEngine( $feed['uri'] );
+                       $engine = self::getEngine( $feed['uri'] );
 
                        if ( isset( $this->mExtras['actionCommentIRC'] ) ) {
                                $actionComment = $this->mExtras['actionCommentIRC'];
@@ -342,24 +342,24 @@ class RecentChange {
        }
 
        /**
-        * Gets the stream engine object for a given URI from $wgStreamLoggers
+        * Gets the stream engine object for a given URI from $wgRCEngines
         *
         * @param $uri string URI to get the engine object for
         * @return object The engine object
         */
-       private static function getStreamEngine( $uri ) {
-               global $wgStreamLoggers;
+       private static function getEngine( $uri ) {
+               global $wgRCEngines;
 
                $scheme = parse_url( $uri, PHP_URL_SCHEME );
                if ( !$scheme ) {
                        throw new MWException( __FUNCTION__ . ": Invalid stream logger URI: '$uri'" );
                }
 
-               if ( !isset( $wgStreamLoggers[$scheme] ) ) {
+               if ( !isset( $wgRCEngines[$scheme] ) ) {
                        throw new MWException( __FUNCTION__ . ": Unknown stream logger URI scheme: $scheme" );
                }
 
-               return new $wgStreamLoggers[$scheme];
+               return new $wgRCEngines[$scheme];
        }
 
        /**